package com.ruibang.glass.quality.controller.finish;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruibang.glass.quality.domain.req.FinishIntervalPaperReq;
import org.springframework.util.StringUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.teaming.cloud.framework2.common.model.ResultBody;
import com.teaming.cloud.framework2.common.pojo.PageRequest;
import com.teaming.cloud.framework2.common.pojo.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.CollectionUtils;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.ruibang.glass.quality.service.FinishIntervalPaperService;
import com.ruibang.glass.quality.entity.FinishIntervalPaper;
import java.util.*;
import lombok.Data;


/**
 * <p>
 * 成品间隔纸受入信息 前端控制器
 * </p>
 *
 * @author wujie
 * @since 2024-03-21
 */
@RestController
@RequestMapping("/api/quality/finish/interval/paper")
@Api(value="成品间隔纸受入信息控制器",tags={"成品间隔纸受入信息接口"})
public class FinishIntervalPaperController {

    
    @Autowired
    private FinishIntervalPaperService finishIntervalPaperService;

    /**
    * 通过id查询
    */
    @GetMapping("/getById/{id}")
    @ApiOperation(value="获取成品间隔纸受入信息",notes="获取成品间隔纸受入信息")
    public ResultBody getById(@PathVariable(value = "id") String id){
        return ResultBody.success(finishIntervalPaperService.getById(id));
    }

    /**
    * 新增
    */
    @PostMapping("/save")
    @ApiOperation(value="新增成品间隔纸受入信息",notes="新增成品间隔纸受入信息")
    public ResultBody save(@RequestBody FinishIntervalPaper finishIntervalPaper){
        finishIntervalPaperService.save(finishIntervalPaper);
        return ResultBody.success();
    }

    /**
    * 通过id删除
    */
    @GetMapping("/deleteById/{id}")
    @ApiOperation(value="通过ID删除成品间隔纸受入信息",notes="通过ID删除成品间隔纸受入信息")
    public ResultBody delete(@PathVariable(value = "id") String id){
        finishIntervalPaperService.delete(id);
        return ResultBody.success();
    }

    /**
    * 修改
    */
    @PostMapping("/update")
    @ApiOperation(value="修改成品间隔纸受入信息",notes="修改成品间隔纸受入信息")
    public ResultBody updateById(@RequestBody FinishIntervalPaper finishIntervalPaper){
        finishIntervalPaperService.updateById(finishIntervalPaper);
        return ResultBody.success();
    }

    /**
    * 分页查询
    */
    @PostMapping("/page")
    @ApiOperation(value="分页列表查询成品间隔纸受入信息",notes="分页列表查询成品间隔纸受入信息")
    public ResultBody page(@RequestBody PageRequest<FinishIntervalPaperReq> pageParam){
        return ResultBody.success(finishIntervalPaperService.queryPage(pageParam));
    }


}
